IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'UserCreate')
	BEGIN
		DROP  Procedure  UserCreate
	END

GO

CREATE Procedure UserCreate
(
	@clientId int,
	@username nvarchar(50),
	@password nvarchar(50),
	@typeFlag int,
	@fullName nvarchar(50),
	@sid nvarchar(50),
	@primaryUser bit,
	@userId int OUTPUT
)
AS

INSERT INTO Users
	(ClientId, Username, Password, TypeFlag, FullName, Sid, PrimaryUser)
VALUES
	(@clientId, @username, @password, @typeFlag, @fullName, @sid, @primaryUser)
	
SET @userId = SCOPE_IDENTITY()

GO